package cn.wusifx.zabbix.request.builder.template;

import cn.wusifx.zabbix.request.BaseRequest;
import cn.wusifx.zabbix.request.builder.CreateRequestBuilder;

import java.util.List;
import java.util.Map;

/**
 * https://www.zabbix.com/documentation/4.0/manual/api/reference/template/massadd
 */
public class TemplateMassaddRequestBuilder extends CreateRequestBuilder {
    private List<Map<String,String>> templates;
    public TemplateMassaddRequestBuilder(String auth) {
        super("template.massadd", auth);
    }

    public TemplateMassaddRequestBuilder(Long id, String auth) {
        super("template.massadd", id, auth);
    }

    public List<Map<String, String>> getTemplates() {
        return templates;
    }

    public TemplateMassaddRequestBuilder setTemplates(List<Map<String, String>> templates) {
        this.templates = templates;
        return this;
    }

    @Override
    public BaseRequest<Map<String, Object>> builder() {
        baseRequest.getParams().put("templates",templates);
        return baseRequest;
    }
}
